#!/bin/sh
#hadoop fs -rmr /user/aaithal/indel/output/cleanup/
#hadoop jar /usr/lib/hadoop/contrib/streaming/hadoop-streaming-0.20.2+737.jar -input /user/aaithal/input/indel/ecoli/partial/1 -output /user/aaithal/indel/output/cleanup/ -mapper cleanup.pl -file cleanup.pl -jobconf mapred.map.tasks=10 -jobconf mapred.reduce.tasks=10 -jobconf name=ind


##################################
time hadoop fs -rmr /user/aaithal/output/indel/chr22/full/new/align
time hadoop jar /usr/lib/hadoop/contrib/streaming/hadoop-streaming-0.20.2+737.jar -input /user/aaithal/input/indel/chr22/full/new/ -output /user/aaithal/output/indel/chr22/full/new/align/ -mapper wrap_align.pl -file wrap_align.pl -reducer wrap_pileup.pl -file wrap_pileup.pl -file chr22.fa  -file chr22.fa.amb  -file chr22.fa.ann  -file chr22.fa.bwt  -file chr22.fa.pac  -file chr22.fa.rbwt  -file chr22.fa.rpac  -file chr22.fa.rsa  -file chr22.fa.sa -jobconf mapred.map.tasks=200 -jobconf mapred.reduce.tasks=20 -jobconf name=inde -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner -jobconf mapred.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator -jobconf stream.num.map.output.key.fields=4 -jobconf mapred.text.key.partitioner.options=-k1,4 -jobconf mapred.text.key.comparator.options=-k1,4 

##################################

##################################
time hadoop fs -rmr /user/aaithal/output/indel/chr22/full/new/merge/
time hadoop jar /usr/lib/hadoop/contrib/streaming/hadoop-streaming-0.20.2+737.jar -input /user/aaithal/output/indel/chr22/full/new/align/ -output /user/aaithal/output/indel/chr22/full/new/merge/ -mapper wrap_sort.pl -file wrap_sort.pl -reducer wrap_merge.pl -file wrap_merge.pl -jobconf mapred.reduce.tasks=50 -jobconf name=inde -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner -jobconf mapred.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator -jobconf stream.num.map.output.key.fields=2 -jobconf mapred.text.key.partitioner.options=-k1,2n -jobconf mapred.text.key.comparator.options=-k2,2n 
##################################
time hadoop fs -rmr /user/aaithal/output/indel/chr22/full/new/sort/
time hadoop jar /usr/lib/hadoop/contrib/streaming/hadoop-streaming-0.20.2+737.jar -input /user/aaithal/output/indel/chr22/full/new/merge/  -output /user/aaithal/output/indel/chr22/full/new/sort/ -mapper wrap_print.pl -file wrap_print.pl -jobconf mapred.reduce.tasks=1 -jobconf name=inde -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner -jobconf mapred.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator -jobconf stream.num.map.output.key.fields=2 -jobconf mapred.text.key.partitioner.options=-k1,2n -jobconf mapred.text.key.comparator.options=-k2,2n 


#hadoop fs -rmr /user/aaithal/indel/output/cleanup/
#hadoop jar /usr/lib/hadoop/contrib/streaming/hadoop-streaming-0.20.2+737.jar -input /user/aaithal/indel/input/ -output /user/aaithal/indel/output/cleanup/ -mapper cleanup.pl -file cleanup.pl -jobconf mapred.map.tasks=10 -jobconf mapred.reduce.tasks=10 -jobconf name=ind
#hadoop fs -rmr /user/aaithal/output/indel/ecoli/full/sam/
#hadoop jar /usr/lib/hadoop/contrib/streaming/hadoop-streaming-0.20.2+737.jar -input /user/aaithal/output/indel/ecoli/full/align -output /user/aaithal/output/indel/ecoli/full/sam/ -mapper wrap_sam.pl -file wrap_sam.pl -jobconf mapred.map.tasks=800 -jobconf mapred.reduce.tasks=1 -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner -jobconf mapred.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator -jobconf stream.num.map.output.key.fields=2 -jobconf mapred.text.key.partitioner.options=-k1,2n -jobconf mapred.text.key.comparator.options=-k2,2n
#-reducer wrap_pileup.pl -file wrap_pileup.pl -jobconf mapred.map.tasks=400 -jobconf mapred.reduce.tasks=1 -jobconf name=inde #-partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner -jobconf mapred.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator -jobconf stream.map.output.field.separator=delim -jobconf stream.num.map.output.key.fields=1 -jobconf map.output.key.field.separator=delim -jobconf mapred.text.key.partitioner.options=-k1,1

#time hadoop fs -rmr /user/aaithal/output/indel/human/chr22/align/
#time hadoop jar /usr/lib/hadoop/contrib/streaming/hadoop-streaming-0.20.2+737.jar -input /user/aaithal/input/indel/human/chr22/ -output /user/aaithal/output/indel/human/chr22/align/ -mapper wrap_align.pl -file wrap_align.pl -jobconf mapred.map.tasks=500 -jobconf mapred.reduce.tasks=10 -jobconf name=inde -partitioner org.apache.hadoop.mapred.lib.KeyFieldBasedPartitioner -jobconf mapred.output.key.comparator.class=org.apache.hadoop.mapred.lib.KeyFieldBasedComparator -jobconf stream.num.map.output.key.fields=2 -jobconf mapred.text.key.partitioner.options=-k1,2n -jobconf mapred.text.key.comparator.options=-k2,2n 
# 
